package com.qumoyugo.springframework.beans.factory.config;

import com.qumoyugo.springframework.beans.factory.HierarchialBeanFactory;
import com.qumoyugo.springframework.util.StringValueResolver;

/**
 * 大多数Bean工厂要实现的配置接口
 */
public interface ConfigurableBeanFactory extends HierarchialBeanFactory, SingletonBeanRegistry {

    String SCOPE_SINGLETON = "singleton";
    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    /**
     * 销毁单例
     */
    void destroySingletons();

    /**
     * 为注解中的嵌入变量增加字符串解析器
     * @param valueResolver
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * 解析注解中的嵌入变量
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);
}
